/*
 * @Author: CemCode cemoment@aliyun.com
 * @Date: 2022-01-18 16:13:43
 * @LastEditors: CemCode cemoment@aliyun.com
 * @LastEditTime: 2023-10-07 15:39:30
 * @FilePath: \nodejs-blog-admin\router\public\article.js
 * @Description: 
 * 
 * Copyright (c) 2022 by CemCode cemoment@aliyun.com, All Rights Reserved. 
 */
const express = require("express");
//引入逻辑处理模块
const handler = require("../../router_handler/public/article");
//表单验证中间件
const expressJoi = require("@escook/express-joi");
const schema = require("../../schema/public/article");
const router = express.Router();

// 获取文章列表
router.use("/list",expressJoi(schema.list_schema),handler.list)

// 获取主题配置信息
router.get("/theme_info",handler.themeInfo);

// 获取文章类别
router.get("/types",handler.getTypeList)

// 获取文章标签
router.get("/labels",handler.getLabelList)

// 通过文章id来获取文章详情数据
router.get("/article",expressJoi(schema.article_schema),handler.article)

// 获取服务器信息
router.get("/server_info",handler.serverInfo)

// 获取文章简列表
router.get("/article_info",handler.articleInfo)

// 普通访客注册账号接口
router.post("/register",expressJoi(schema.register_schema),handler.register)

// 发送验证码
router.post("/send_code",expressJoi(schema.send_code),handler.send_code)

// 用户登录
router.post("/login",expressJoi(schema.login),handler.login)

// 新增评论
router.post("/send_comment",expressJoi(schema.send_comment),handler.send_comment)

// 获取文章评论
router.get("/article_comment",expressJoi(schema.article_comment),handler.article_comment)

module.exports = router;